package cn.edu.uestc.framework.exception;

/**
 * 封装业务异常
 * Created by Eric on 2017/6/9.
 */
public class TKBusinessException extends RuntimeException {
    private final String message;
    private final int errorId;

    /**
     * 把自定义的消息包装到原来的exception上
     *
     * @param exception 原有的异常
     * @param errorId   自定义的错误的id
     */
    public TKBusinessException(Exception exception, int errorId, String message) {
        super(exception);
        this.errorId = errorId;
        this.message = message;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public int getErrorId() {
        return errorId;
    }
}
